# -*- coding: utf-8 -*-

# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html

import scrapy
from scrapy.item import DictItem, Field


class NewscrawlerItem(scrapy.Item):
    # define the fields for your item here like:
    name = scrapy.Field()


def create_item_class(class_name, field_list):
    field_dict = {}
    for field_name in field_list:
        field_dict[field_name] = Field()
    return type(str(class_name), (DictItem,), {'fields': field_dict})


class NewsItem(scrapy.Item):
    datetime = scrapy.Field()
    title = scrapy.Field()
    href = scrapy.Field()
    symbol = scrapy.Field()
